package edu.ccut.titan.tag.report.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import edu.ccut.titan.tag.report.design.CellInfo;
import edu.ccut.titan.tag.report.design.HeaderInfo;

public class TitanReportHeaderTag extends TagSupport {
	private static final long serialVersionUID = 5926977096632331461L;
	private String value;
	private String title;
	private String height="0";
	private String width="0";
	private String x ="0";
	private String y="0";
	private TitanReportTag reportTag;
	private HeaderInfo headerInfo;

	@Override
	public int doStartTag() throws JspException {
		reportTag = (TitanReportTag) this.getParent();
		headerInfo = new HeaderInfo();
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		headerInfo.setHeight(height);
		headerInfo.setTitle(title);
		headerInfo.setValue(value);
		headerInfo.setWidth(width);
		headerInfo.setX(x);
		headerInfo.setY(y);
		reportTag.addHeaderInfo(headerInfo);
		return SKIP_BODY;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getX() {
		return x;
	}

	public void setX(String x) {
		this.x = x;
	}

	public String getY() {
		return y;
	}

	public void setY(String y) {
		this.y = y;
	}

}
